/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.wanhai.itm.wditm101.vm;

 
import com.wanhai.itm.util.LoadOption;
import com.wanhai.itm.util.WD_DefaultVM;
import com.wanhai.itm.wditm101.vo.Wditm101_ITM4001VO;
import java.util.List;
import javax.faces.model.SelectItem;
import org.zkoss.bind.annotation.AfterCompose;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ContextParam;
import org.zkoss.bind.annotation.ContextType;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.Selectors;
import org.zkoss.zul.Window;
 

public class Wditm101_hourVM extends WD_DefaultVM<Wditm101_ITM4001VO> {
     
    private List<SelectItem> dayOfWeekList = LoadOption.getDayOfWeek();
    private List<SelectItem> dayOfWeekList2= LoadOption.getDayOfWeek();
    private List<SelectItem> pmOffList= LoadOption.getYesOrNo();
    
    
    ///<editor-fold defaultstate="collapsed" desc="binding UI component">
//        @Wire("#ENTRY_USER")
//        private Textbox entryUser;
        //</editor-fold>
    
    public Wditm101_hourVM(){
        super(Wditm101_ITM4001VO.class);
    }
        
    @Init
    public void init(){
    }
    
    
    @Command("preInsert")
    @NotifyChange({"selected","actionFlag"})
    public void preInsert() throws Exception{
        this.setActionFlag("insert");
        
        //default value
        Wditm101_ITM4001VO insertVo = new Wditm101_ITM4001VO();
        insertVo.setPM_OFF("N");
        insertVo.setWORKING_HOURS("8");
        
        this.setSelected(insertVo);
        
        ((Window)inc1.getFellow("operatorWin")).doModal();
    }
    
    
    
    
    
    
    
    @AfterCompose
    public void afterCompose(@ContextParam(ContextType.VIEW) Component view){
        Selectors.wireComponents(view, this, false);
    }


    
    
    
    
    //<editor-fold defaultstate="collapsed" desc="getter setter">

    public List<SelectItem> getDayOfWeekList() {
        return dayOfWeekList;
    }

    public void setDayOfWeekList(List<SelectItem> dayOfWeekList) {
        this.dayOfWeekList = dayOfWeekList;
    }

    public List<SelectItem> getDayOfWeekList2() {
        return dayOfWeekList2;
    }

    public void setDayOfWeekList2(List<SelectItem> dayOfWeekList2) {
        this.dayOfWeekList2 = dayOfWeekList2;
    }
    
    public List<SelectItem> getPmOffList() {
        return pmOffList;
    }

    public void setPmOffList(List<SelectItem> pmOffList) {
        this.pmOffList = pmOffList;
    }
    //</editor-fold>







}
